package com.spsa.persistencia.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;

import com.spsa.persistencia.entidades.Interfaz;
import com.spsa.persistencia.utilidades.UtilManager;

public class InterfazDao {

	public static List<Interfaz> listar() {
        EntityManager em = UtilManager.getEntityManager();
        EntityTransaction et = em.getTransaction();
        et.begin();
        Query query = em.createQuery("select i FROM Interfaz i");
        List<Interfaz> interfaces = query.getResultList();
        et.commit();
        em.close();
        
        return interfaces;
	}

}
